<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改转换')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-trans-edit" th:object="${kettleTrans}">
            <input name="id" th:field="*{id}" type="hidden">
            <input name="transRepositoryId"  class="form-control" type="hidden" th:field="*{transRepositoryId}"  id="transRepositoryId"   >
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">转换名称：</label>
                <div class="col-sm-8">
                    <input name="transName" th:field="*{transName}" class="form-control" type="text" required readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">转换描述：</label>
                <div class="col-sm-8">
                    <textarea name="transDescription" class="form-control">[[*{transDescription}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">路径：</label>
                <div class="col-sm-8">
                    <input name="transPath" th:field="*{transPath}" class="form-control" type="text" required readonly>
                </div>
            </div>
<!--            <div class="form-group">
                <label class="col-sm-3 control-label">所属资源库id：</label>
                <div class="col-sm-8">
                    <input name="transRepositoryId" th:field="*{transRepositoryId}" class="form-control" type="text">
                </div>
            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">日志级别：</label>
                <div class="col-sm-8">
                    <select name="transLogLevel" class="form-control m-b" th:with="type=${@dict.getType('kettle_log_level')}"  th:field="*{transLogLevel}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"  ></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否监控：</label>
                <div class="col-sm-8">
<!--                    <label class="toggle-switch switch-solid">
                        <input name="isMonitorEnabled" type="checkbox" id="status" th:checked="${kettleTrans.isMonitorEnabled == 1 ? true : false}">
                        <span></span>
                    </label>-->
                    <label class="radio-box">
                        <input type="radio" checked="" value=1 id="optionsRadios1" name="isMonitorEnabled" th:checked="${kettleTrans.isMonitorEnabled == 1 ? true : false}">是</label>
                    <label class="radio-box">
                        <input type="radio" value=0 id="optionsRadios2" name="isMonitorEnabled" th:checked="${kettleTrans.isMonitorEnabled == 0 ? true : false}">否</label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">角色key:</label>
                <div class="col-sm-8">
                    <select class="form-control noselect2 selectpicker  m-b "     name="roleKey"  data-none-selected-text="可以执行该转换的角色组合" multiple   >
                        <option th:each="allRoles:${allRoles}" th:value="${allRoles}" th:text="${allRoles}"   ></option>
                    </select>
                </div>
            </div>
<!--            <div class="form-group">
                <label class="col-sm-3 control-label">可执行角色：</label>
                <div class="col-sm-8">
                    <textarea name="roleKey" class="form-control" placeholder="可以执行该转换的角色组合,用','连接,如:admin,guest,表示admin角色和guest角色都可以执行该转换">[[*{roleKey}]]</textarea>
                </div>
                <div class="col-sm-8">
                    <select class="form-control noselect2 selectpicker  m-b"    name="roleKey"  data-none-selected-text="可以执行该转换的角色组合" multiple   >
                        <option th:each="allRoles:${allRoles}" th:value="${allRoles}" th:text="${allRoles}"   ></option>
                    </select>
                </div>
            </div>-->
<!--            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remark" th:field="*{remark}" class="form-control" type="text">
                </div>
            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <th:block th:include="include :: bootstrap-select-js" />
    <script th:inline="javascript">
        var rkArray = [[${rkArray}]];
        $('.selectpicker').selectpicker('val',rkArray);
        var prefix = ctx + "kettle/trans";
        $("#form-trans-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-trans-edit').serialize());
            }
        }
    </script>
</body>
</html>